package org.azmat.springcache.SQL.Entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import jakarta.persistence.Column;
import jakarta.persistence.Entity;
import jakarta.persistence.Id;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

// Book实体类
@Data
@AllArgsConstructor
@NoArgsConstructor
@Entity(name = "book")
@TableName("book")
public class Book {
    // 主键id
    @Id()
    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;

    // 书名
    @Column(name = "name")
    @TableField("name")
    private String name;

    // 类型
    @Column(name = "type")
    @TableField("type")
    private String type;

    // 作者
    @Column(name = "author")
    @TableField("author")
    private String author;

    // 价格
    @Column(name = "price")
    @TableField("price")
    private Double price;
}